Peacekeeping and Militarized Interstate Disputes
Replication Package README

Package contents
1. 01_main_analysis_jcr.R
   Main-text replication script. Produces the main manuscript tables, figures, run log, and session information.

2. 02_online_appendix_replication.R
   Online appendix replication script. Produces the appendix tables, appendix figures, and appendix Word document.

3. data.dta
   Analysis-ready Stata dataset used by both scripts.

Software requirements
- R 4.2 or newer recommended
- Stata is not required to run the scripts

R packages used in the scripts
haven, dplyr, tibble, tidyr, stringr, ggplot2, MASS, pscl, sandwich, lmtest,
officer, flextable, cowplot, scales, mice, lme4, MatchIt, survival

Package installation
Both scripts attempt to install missing R packages automatically. If internet access is unavailable,
install the required packages manually before running the scripts.

Important note on the dataset
The file data.dta is the analysis-ready dataset used for replication. It contains the variables,
sample indicators, and derived fields required by the scripts, including sample_T1, sample_T2,
sample_T3, neverpk_dummy, cum_peace_10pp, high_igo, and no_contig.

Working directory
Place the two R scripts and data.dta in the same working directory before running the code.

Recommended path setting
For public replication use, set the data path in both scripts to:
DATA_PATH <- "data.dta"

Run order
1. Run 01_main_analysis_jcr.R
2. Run 02_online_appendix_replication.R

Main-text outputs
The main script writes output to:
- pk_outputs/main_text
- pk_outputs/main_figures
- pk_outputs/main_aux

Primary main-text files
- pk_outputs/main_text/PKMID_JCR_Main_Replication.docx
- pk_outputs/main_aux/run_log.txt
- pk_outputs/main_aux/sessionInfo_v4.16.txt

Online appendix outputs
The appendix script writes output to:
- pk_outputs/supplementary
- pk_outputs/appendix_figures

Primary appendix file
- pk_outputs/supplementary/PKMID_JCR_Online_Appendix.docx

Substantive notes
- The main-text script estimates ordered logit, logit, and zero-inflated negative binomial models.
- The main-text script uses clustered inference for GLM and ZINB models and robust ordered-logit inference.
- The online appendix script uses model-based inference by design for the supplementary analyses.
- Random seeds are fixed at 1025.

Expected sample sizes
The full dataset contains 4,307 country-year observations.
The main analytic samples used by the main-text models contain 4,128 observations, unless otherwise noted.

Replication guidance
The scripts are designed to reproduce the main manuscript and online appendix outputs from the supplied
analysis-ready dataset. Small numerical or formatting differences may occur across operating systems,
R versions, or package versions, especially in optimization-based models, confidence intervals, and figure rendering.

Troubleshooting
1. If the scripts cannot find the dataset, confirm that DATA_PATH is set to "data.dta" and that the working
directory contains the dataset.
2. If package installation fails, install the listed packages manually and rerun the scripts.
3. If Word output cannot be written, close any existing open version of the target .docx file and rerun.
4. If figure rendering differs slightly across machines, check package versions, fonts, and graphics devices.

Contact
Bulbul Ahmed
